package com.steak.concurrent.objects;

import lombok.SneakyThrows;

public class AwaitTimeoutTest {
    public static void main(String[] args) {
        Object obj = new Object();
        new Thread(new Runnable() {
            @SneakyThrows
            @Override
            public void run() {
                synchronized (obj){
                    obj.wait(0);
                }
                System.out.println("thread-1");
            }
        }).start();

        new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("thread-2");
            }
        }).start();
    }
}
